#ifndef _DSW3GP_H
#define _DSW3GP_H

#include "base.h"

class CDsw3gp
{
public:
	CDsw3gp(LPST_ENV_T pEnv, MP4FileHandle h3gp);
	virtual ~CDsw3gp();
public:
	static CDsw3gp* createNew(LPST_ENV_T pEnv, char* pFileName);
	void GetStoreFileResolution(int &nWidth, int &nHeight, int &nBitrate, int &nFps, int &nDuration);
	void SetOffset(int nSeconds);
	bool ReadFrame(unsigned char* pFrame, int &nLen);
private:
	LPST_ENV_T m_pEnv;
	
	int m_nWidth, m_nHeight, m_nFps, m_nBitrate;
	int m_nTotalFrames;
	MP4FileHandle m_h3gp;
	uint8_t **m_pSps, **m_pPps;
	uint32_t *m_pSpsLen, *m_pPpsLen;
	int m_nCurFrameId;
};

#endif

